
dados=read.table("dados.txt", head=T, sep=",")

par(mfrow=c(1,2)) 

par(bty='l') 

par(mar=c(5,3.8,1,1.1)) 

print(plot(dados$y1~dados$x1, pch=17, cex=1.5, xlab='Log(Patch size)(ha)', ylab='', cex.lab=1.5, ylim=c(0,3), xlim=c(0.5,2.2), cex.axis=1.5, xaxt='n', yaxt='n')) ##Plotagem do gráfico. 

print(axis(1, tck=0.02, labels=FALSE)) 

print(axis(2, tck=0.02, labels=FALSE)) 

print(text(2.2,3,'a',cex=2)) 

print(mtext(c('0.5','1.0','1.5','2.0','0.0','0.5','1.0','1.5','2.0','2.5','3.0'), side=c(1,1,1,1,2,2,2,2,2,2,2), at=c(0.5,1,1.5,2,0,0.5,1,1.5,2,2.5,3), line=c(1,1,1,1,1,1,1,1,1,1,1,1), cex=1.2)) 

print(mtext('Euclidean distances', side=2, at=1.5, line=2.3, cex=2)) 

modelo=lm(dados$y1~dados$x1) 

a=2.4594 
b=-0.5173 
x0=0.5 
x1=2.16 
y0=a+(b*x0) 
y1=a+(b*x1) 

print(segments(x0=x0, y0=y0, x1=x1, y1=1.02, lwd=2.5)) 

par(mar=c(5,1.2,1,1)) 

print(boxplot(dados$x2~dados$y2, ylim=c(0,3), outline=FALSE, xaxt='n', yaxt='n')) 

print(axis(1, tck=0.02, labels=FALSE)) 

print(axis(2, tck=0.02, labels=FALSE)) 

print(text(c(1,2,3,4,5,6.5),3,c('*','*','**','*','***','b'),cex=1.9)) 

print(mtext(c('Small','Medium','Edge','Medium','Interior','Large','Edge','Large','Interior',
              'Control','0.0','0.5','1.0','1.5','2.0','2.5','3.0'), 
            side=c(1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2), 
            at=c(1,2,2,3,3,4,4,5,5,6,0,0.5,1,1.5,2,2.5,3), 
            line=c(1,0.6,1.8,0.6,1.8,0.6,1.8,0.6,1.8,1,1,1,1,1,1,1,1), cex=1.25)) 